<?php
$di = \Phalcon\Di::getDefault();
$userSettings = $di->getShared('config')->get('m.user.config');
return array(
    '_id' => 'adminUserEditForm',
    '_form' => array(
        'method' => 'post',
        'ajax-submit' => '#main',
        'accept-charset' => 'utf-8',
        'role' => 'form',
        'id' => 'adminUserEditForm',
    ),
    'name' => array(
        'left' => true,
        'widget' => 'Text',
        'isLabel' => true,
        '_access' => [],
        'required' => true,
        'baseField' => true,
        'attributes' => array(
            'class' => 'form-control',
        ),
        'error' => '',
        'label' => '用户名',
        'description' => '用户名',
        'xunsearch' => [
            'type' => 'title',
        ]
    ),
    'description' => array(
        'left' => true,
        'widget' => 'Textarea',
        'access' => array(
            'addForm' => true,
            'editForm' => true,
        ),
        'required' => false,
        'addition' => true,
        'label' => '简介',
        'description' => '内容简介',
        'error' => '',
        'default' => '',
        'attributes' => array(
            'class' => 'form-control',
        ),
        'xunsearch' => [
            'type' => 'body',
        ],
    ),
    'email' => array(
        'left' => true,
        'widget' => 'Email',
        'addForm' => false,
        'editForm' => false,
        'default' => null,
        'required' => false,
        'baseField' => true,
        '_access' => array(
            'roles' => ['admin'],
            'path' => [
                '|.*?/admin/.*|',
            ],
        ),
        'attributes' => array(
            'class' => 'form-control',
        ),
        'error' => '',
        'label' => '用户邮箱',
        'description' => '',
    ),
    'phone' => array(
        'left' => true,
        'field' => 'string',
        'widget' => 'Text',
        '_access' => array(
            'roles' => ['admin'],
            'path' => [
                '|.*?/admin/.*|',
            ],
        ),
        'default' => null,
        'required' => false,
        'baseField' => true,
        'attributes' => array(
            'class' => 'form-control',
        ),
        'error' => '',
        'label' => '电话',
        'description' => '',
    ),
    'score' => array(
        'right' => true,
        'widget' => 'Numeric',
        'isLabel' => true,
        '_access' => array(
            'roles' => ['admin'],
            'path' => [
                '|.*?/admin/.*|',
            ],
        ),
        'minLength' => 1,
        'maxLength' => 11,
        'isTitle' => true,
        'number' => 1,
        'required' => false,
        'default' => 0,
        'addition' => true,
        'label' => '积分',
        'description' => '',
        'error' => '',
        'attributes' => array(
            'class' => 'form-control',
        ),
    ),
    'gold' => array(
        'right' => true,
        'widget' => 'Numeric',
        'isLabel' => true,
        'default' => 0,
        'required' => false,
        '_access' => array(
            'roles' => ['admin'],
            'path' => [
                '|.*?/admin/.*|',
            ],
        ),
        'minLength' => 1,
        'maxLength' => 11,
        'isTitle' => true,
        'number' => 1,
        'addition' => true,
        'label' => '财富',
        'description' => '',
        'error' => '',
        'model' => '\Modules\User\Entity\Fields\UserFieldGold',
        'attributes' => array(
            'class' => 'form-control',
        ),
    ),
    'face' => array(
        'model' => '\Modules\User\Entity\Fields\UserFieldFace',
        'field' => 'file',
        'isLabel' => true,
        '_access' => array(
            'roles' => ['admin'],
            'path' => [
                '|.*?/admin/.*|',
            ],
        ),
        'minLength' => 1,
        'maxLength' => 11,
        'isTitle' => true,
        'left' => true,
        'number' => 1,
        'addition' => true,
        'label' => '头像',
        'description' => '',
        'error' => '',
        'attributes' => array(
            'class' => 'form-control',
        ),
    ),
    'password' => array(
        'left' => true,
        'field' => 'string',
        'widget' => 'Password',
        '_access' => array(
            'roles' => ['admin'],
            'path' => [
                '|.*?/admin/.*|',
            ],
        ),
        'required' => true,
        'baseField' => true,
        'attributes' => array(
            'class' => 'form-control',
        ),
        'error' => '',
        'label' => '密码',
        'description' => '',
    ),
    'confirmPassword' => array(
        'left' => true,
        'field' => 'string',
        'widget' => 'Password',
        '_access' => array(
            'roles' => ['admin'],
            'path' => [
                '|.*?/admin/.*|',
            ],
        ),
        'required' => true,
        'baseField' => true,
        'attributes' => array(
            'class' => 'form-control',
        ),
        'error' => '',
        'label' => '确认密码',
        'description' => '',
    ),
    'active' => array(
        'right' => true,
        'widget' => 'Select',
        '_access' => array(
            'roles' => ['admin'],
            'path' => [
                '|.*?/admin/.*|',
            ],
        ),
        'length' => 10,
        'default' => 0,
        'required' => false,
        'options' => array(
            '未激活', '已激活',
        ),
        'attributes' => array(
            'class' => 'form-control',
        ),
        'description' => '',
        'error' => '',
        'label' => '激活状态',
    ),
    'validate' => array(
        'right' => true,
        'widget' => 'Selects',
        '_access' => array(
            'roles' => ['admin'],
            'path' => [
                '|.*?/admin/.*|',
            ],
        ),
        'label' => '验证',
        'required' => false,
        'options' => array(
            'phone' => '手机认证',
            'email' => 'Email认证',
        ),
        'description' => '用户的验证状态',
        'error' => '',
        'attributes' => array(
            'class' => 'form-control',
            'size' => 2,
        ),
    ),
    'created' => array(
        'widget' => 'Date',
        '_access' => array(
            'roles' => ['admin'],
            'path' => [
                '|.*?/admin/.*|',
            ],
        ),
        'required' => false,
        'label' => '注册时间',
        'default' => time(),
        'description' => '账户注册时间',
        'error' => '',
        'filter' => [
            'int', 'intval',
        ],
        'xunsearch' => [
            'type' => 'numeric',
            'index' => 'self',
        ],
        'attributes' => array(
            'class' => 'form-control',
        ),
    ),
    'contentModel' => array(
        '_access' => array(
            'roles' => ['admin'],
            'path' => [
                '|.*?/admin/.*|',
            ],
        ),
        'widget' => 'Selects',
        'left' => true,
        'required' => true,
        'default' => array('user' => 'user'),
        'options' => getRolesOptions(),
        'label' => '角色',
        'description' => '',
        'error' => '',
        'attributes' => array(
            'class' => 'form-control',
        ),
    ),
    /*'verCode' => array(
    'label' => '验证码',
    'userOptions' => array(),
    'error' => '',
    'description' => '请你输入你看到的验证码',
    'field' => 'validateCode',
    'widget' => 'ValidateCode',
    '_access' => array(
    'expath' => array(
    '/admin/.*',
    '/.*?/admin/.*'
    )
    ),
    'validate' => array(
    array(
    'v' => 'Function',
    'function' => '\Core\Library\ValidateCode::validate',
    'message' => '验证码输入错误',
    ),
    ),
    'validate' => array(),
    'attributes' => array(),
    'required' => true,
    ),*/
    '_options' => array(
        'xunsearch' => strtolower(WEB_CODE) . '_user',
        'error' => '注册失败',
        'success' => '注册成功',
    ),
);
